package cn.waqwb.my.shop.dao.impl;

import cn.waqwb.my.shop.dao.UserDao;
import cn.waqwb.my.shop.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UserDaoImpl implements UserDao {

    private static final Logger logger = LoggerFactory.getLogger(UserDaoImpl.class);

    @Override
    public User getUser(String email, String password) {
        logger.debug("调用getUser()方法，参数为：email:{} password:{}",email,password);
        User user = null;
        if ("qiuwb@tedu.cn".equals(email) && "123123".equals(password)){
            user = new User();
            user.setEmail("qiuwb@tedu.cn");
            user.setUsername("JokerQ");
            logger.info("成功获取\"{}\"的用户信息",user.getUsername());
        } else {
            logger.error("获取\"{}\"用户信息失败",user.getEmail());
        }
        return user;
    }
}
